package de.eeb.common;

import android.os.Parcel;
import android.os.Parcelable;

public class ContactParcel implements Parcelable {

	public static final Parcelable.Creator<ContactParcel> CREATOR = new Parcelable.Creator<ContactParcel>() {
		public ContactParcel createFromParcel(Parcel in) {
			return new ContactParcel(in);
		}

		public ContactParcel[] newArray(int size) {
			return new ContactParcel[size];
		}
	};
	
	String name;
	String number;
	String hash;
	int isParticipating;

	public ContactParcel(Parcel source) {
		name = source.readString();
		number = source.readString();
		hash = source.readString();
		isParticipating = source.readInt();
	}

	@Override
	public int describeContents() {
		return hash.hashCode();
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(name);
		dest.writeString(number);
		dest.writeString(hash);
		dest.writeInt(isParticipating);
	}

	@Override
	public String toString() {
		return name + " [" + number + "] P:" + isParticipating;
	}
	
	public ContactParcel(String name, String number, String hash,
			int isParticipating) {
		this.name = name;
		this.number = number;
		this.hash = hash;
		this.isParticipating = isParticipating;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getHash() {
		return hash;
	}

	public void setHash(String hash) {
		this.hash = hash;
	}

	public int getIsParticipating() {
		return isParticipating;
	}

	public void setIsParticipating(int isParticipating) {
		this.isParticipating = isParticipating;
	}
}
